<!--上传文件-->
<link rel="stylesheet" href="__STATIC__/admin/css/edit_common.css">

<link rel="stylesheet"type="text/css"href="__STATIC__/admin/uploadify/uploadify.css" />

<link rel="stylesheet" type="text/css" href="__CSS__/style.css"/>
<style>
    #commodity_main input[type=text]{width: 98%;}
    #commodity_main input[type=file]{margin-bottom: 10px;}
    #commodity_main img{width: 120px;height: 120px;border-radius: 50%;background-color: #FFFFFF;border-color:#FFFFFF;}
</style>

<div id="commodity_details">
    <h1 style="margin-top: 0px!important;">
        <img src="__STATIC__/admin/img/ico.png">
        时装发布
    </h1>
    </h1>
</div>

<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <form class="form-horizontal" role="form" method="post" url="{:url()}" id="edit_form">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 图片 </label>
                    <div class="col-sm-9">
                        <select name="id">
                            {foreach name="list" item="ls"}
                            <option value="{$ls['id']}">{$ls['note']}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 图片 </label>
                    <div class="col-sm-9">
                        <input id="file_upload"  type="file" multiple="true" >
                        <img style="display: none" id="upload_org_code_img" src="{$config['config_image']}" width="150" height="150">
                        <input id="file_upload_image" name="config_value" type="hidden" multiple="true" value="{$config['config_image']}">
                    </div>
                </div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="button" id="li1_btn">
                            <i class="icon-ok bigger-110"></i>
                            保存
                        </button>
                    </div>
                </div>
            </form>

            <!-- banner -->
            <div class="banner">
                <div class="container">
                    <ul id="flexiselDemo3">
                        {foreach name="list" item="l"}
                        <li>
                            <a href="javaScript:void(0);">
                                <div class="banner-1">
                                    <img src="{$l['config_value']}" class="img-responsive" alt="">
                                    <div class="cat_top">
                                        <i class="fa fa-thumbs-up" aria-hidden="false"></i>
                                        <p></p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        {/foreach}
                    </ul>

                    <script type="text/javascript">
                        $(window).load(function() {

                            $("#flexiselDemo3").flexisel({
                                visibleItems: 5,
                                animationSpeed: 1000,
                                autoPlay: false,
                                autoPlaySpeed: 3000,
                                pauseOnHover: true,
                                enableResponsiveBreakpoints: true,
                                responsiveBreakpoints: {
                                    portrait: {
                                        changePoint:480,
                                        visibleItems: 2
                                    },
                                    landscape: {
                                        changePoint:640,
                                        visibleItems: 3
                                    },
                                    tablet: {
                                        changePoint:768,
                                        visibleItems: 3
                                    }
                                }
                            });

                            $('.banner-1').hover(function(){
                                $(this).children('div').hide();
                            },function(){
                                $(this).children('div').show();
                            });
                        });
                    </script>
                    <script type="text/javascript" src="__JS__/jquery.flexisel.js"></script>
                </div>
            </div>
            <div class="clearfix"> </div>
            <!-- banner -->
        </div><!-- /.col -->
    </div><!-- /.row -->

</div><!-- /.page-content -->

{load href="__STATIC__/admin/js/image.js" /}
<script>
    $(".sy").addClass("active open");
    $(".sy .szfb").addClass("active");

    $('#li1_btn').click(function(){
        $.ajax({
            type: 'POST',
            url: "{:url('index/saveConfig')}",
            data: $('#edit_form').serialize(),
            dataType: "json",
            beforeSend: function() {
                $('#li1_btn').attr('disabled','true');
                $('#li1_btn').attr('value','上传中...');
            },
            success: function(data) {
                alert(data.message);
                if(0==data.status){
                    window.location.reload()
                }else{
                    $('#li1_btn').removeAttr('disabled');
                    $('#li1_btn').attr('value','保存');
                }
            }
        });
    });
</script>
